<%--
  Created by IntelliJ IDEA.
  User: Wang
  Date: 2019/7/20
  Time: 10:18
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
    <link href="https://cdn.bootcss.com/bootstrap-datetimepicker/4.17.47/css/bootstrap-datetimepicker.min.css" rel="stylesheet">

    <!-- jQuery (Bootstrap 插件需要引入) -->
    <script src="http://cdn.static.runoob.com/libs/jquery/2.1.1/jquery.min.js"></script>
    <!-- 包含了所有编译插件 -->
    <script src="statics/css/bootstrap.min.css"></script>
    <script src="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.js"></script>
    <script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <script src="https://cdn.bootcss.com/moment.js/2.24.0/moment-with-locales.js"></script>
    <script src="https://cdn.bootcss.com/bootstrap-datetimepicker/4.17.47/js/bootstrap-datetimepicker.min.js"></script>
    <script type="text/javascript">
        //修改用户
        function bianji(itemId) {
            $.ajax({
                url:"/ssmZY_war_exploded/wuliao/chakanid",
                type:"post",
                contentType:"application/x-www-form-urlencoded; charset=utf-8",
                dataType:"json",
                data:{itemId:itemId},
                success:function (data) {
                    $("#xiugaiform").modal("show");
                    $("#itemId1").val(data.itemId);
                    $("#itemCode1").val(data.itemCode);
                    $("#itemDescription1").val(data.itemDescription);
                    $("#itemUom1").val(data.itemUom);
                    $("#startActiveDate1").val(new Date(data.startActiveDate).format("yyyy-MM-dd"));
                    $("#endActiveDate1").val(new Date(data.endActiveDate).format("yyyy-MM-dd"));
                    $("#enabledFlag1").val(fmtBoolean(data.enabledFlag));
                    itemId_update=data.itemId;
                },
                error:function () {
                    alert("获取用户数据失败");
                }
            });
        }
    </script>
</head>
<body>

<%--编辑页面--%>
<form role="form" action="/ssmZY_war_exploded/wuliao/bianji" method="post" id="biaojiform">
    <div class="modal fade" id="xiugaiform" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                        &times;
                    </button>
                    <h4 id="mytitle1" class="modal-title" id="myModalLabel1">
                        编辑用户:
                    </h4>
                </div>
                <div class="modal-body">
                    <input type="hidden" id="itemId1" name="itemId"/>
                    <div class="form-group">
                        <label for="itemCode1">物料编码:</label>
                        <input type="text" class="form-control"  id="itemCode1" name="itemCode" placeholder="itemCode" autofocus="autofocus" disabled>
                    </div>
                    <div class="form-group">
                        <label for="itemDescription1">物料描述</label>
                        <input type="text" class="form-control" id="itemDescription1" name="itemDescription">
                    </div>
                    <div class="form-group">
                        <label for="itemUom1">物料单位</label>
                        <select id="itemUom1" class="form-control" name="itemUom">
                            <option >米</option>
                            <option >平方米</option>
                            <option >立方米</option>
                            <option >千克</option>
                            <option >个</option>
                            <option >其他</option>
                        </select>
                    </div>
                    <div class="form-group">
                        <label for="startActiveDate1">生效时间从</label>
                        <input type="date" class="form-control" placeholder="生效时间从" id="startActiveDate1" name="startActiveDate">
                    </div>
                    <div class="form-group">
                        <label for="endActiveDate1">生效时间至</label>
                        <input type="date" class="form-control" placeholder="生效时间至" id="endActiveDate1" name="endActiveDate">
                    </div>
                    <div class="form-group">
                        <label for="enabledFlag1">是否启用</label>
                        <select id="enabledFlag1" class="form-control" name="enabledFlag">
                            <option >是</option>
                            <option >否</option>
                        </select>
                    </div>
                    <button type="button" class="btn btn-info" data-dismiss="modal">返回</button>
                    <button type="button" class="btn btn-danger" onclick="sub('${itemId}')">保存</button>
                </div>
            </div>
        </div>
    </div>
</form>

</body>
</html>
